<?php
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_address')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `u_id` int(11) NOT NULL,
  `address` varchar(100) NOT NULL,
  `addressname` varchar(20) NOT NULL,
  `phone` varchar(11) NOT NULL,
  `addressdetail` varchar(100) NOT NULL,
  `state` tinyint(1) NOT NULL,
  `uniacid` int(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);

pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_cashlist')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `u_id` int(11) NOT NULL,
  `realname` varchar(10) NOT NULL,
  `cash` varchar(11) NOT NULL,
  `realcash` varchar(11) NOT NULL,
  `type` tinyint(1) NOT NULL,
  `state` tinyint(1) NOT NULL,
  `phone` varchar(11) NOT NULL,
  `password` varchar(32) NOT NULL,
  `wechat` varchar(32) NOT NULL,
  `applytime` datetime NOT NULL,
  `cashtime` datetime NOT NULL,
  `uniacid` int(11) NOT NULL,
  `openid` varchar(300) NOT NULL,
  `formid` varchar(32) NOT NULL,
  `yhk` varchar(32) NOT NULL,
  `zfb` varchar(32) NOT NULL,
  `mode` tinyint(1) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_cashset')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `mode` tinyint(1) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `min` varchar(11) NOT NULL,
  `rate` varchar(11) NOT NULL,
  `cashrule` text NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);

pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_catelevel')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `dbcate` tinyint(1) NOT NULL,
  `shotcate` tinyint(1) NOT NULL,
  `marketcate` tinyint(1) NOT NULL,
  `pricate` tinyint(1) NOT NULL,
  `uniacid` int(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_cusmanage')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `shot_id` int(11) NOT NULL,
  `shotcate` varchar(10) NOT NULL,
  `cusname` varchar(20) NOT NULL,
  `cusaddress` varchar(30) NOT NULL,
  `addressdetail` varchar(30) NOT NULL,
  `username` varchar(10) NOT NULL,
  `phone` varchar(20) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `time` datetime NOT NULL,
  `openid` varchar(300) NOT NULL,
  `avatar` varchar(255) NOT NULL,
  `formid` varchar(50) NOT NULL,
  `paycode` varchar(50) NOT NULL,
  `cardimg` varchar(300) NOT NULL,
  `liceneimg` varchar(300) NOT NULL,
  `pay` tinyint(1) NOT NULL,
  `sh` tinyint(1) NOT NULL,
  `password` varchar(32) NOT NULL,
  `paytime` datetime NOT NULL,
  `topfee` int(11) NOT NULL,
  `upfee` tinyint(1) NOT NULL,
  `view` text NOT NULL,
  `type` tinyint(4) NOT NULL COMMENT '0、普通商家；1、定制商家',
  `bannerimg` varchar(600) NOT NULL,
  `latlng` varchar(50) NOT NULL,
  `storedetail` text NOT NULL,
  `storeimg` varchar(255) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);

pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_cusmoney')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `publishfee` varchar(11) NOT NULL,
  `upfee` varchar(11) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `topfee` varchar(11) NOT NULL,
  `dpublishfee` varchar(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_dbassess')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `u_id` int(11) NOT NULL,
  `p_id` int(11) NOT NULL,
  `content` text NOT NULL,
  `uniacid` int(11) NOT NULL,
  `time` datetime NOT NULL,
  `state` tinyint(1) NOT NULL,
  `formid` varchar(30) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);

pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_dbmoney')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `publishfee` varchar(11) NOT NULL,
  `upfee` varchar(11) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `topfee` varchar(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_dbpublish')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `video` varchar(255) NOT NULL,
  `c_id` int(11) NOT NULL,
  `dbname` varchar(20) NOT NULL,
  `dbfee` varchar(11) NOT NULL,
  `detail` varchar(280) NOT NULL,
  `upfee` tinyint(1) NOT NULL,
  `topfee` tinyint(1) NOT NULL,
  `pay` tinyint(1) NOT NULL,
  `time` datetime NOT NULL,
  `uniacid` int(11) NOT NULL,
  `phone` varchar(11) NOT NULL,
  `formid` varchar(32) NOT NULL,
  `paycode` varchar(32) NOT NULL,
  `state` tinyint(1) NOT NULL,
  `videoimg` varchar(255) NOT NULL,
  `view` text NOT NULL,
  `agree` text NOT NULL,
  `avatar` varchar(255) NOT NULL,
  `username` varchar(20) NOT NULL,
  `openid` varchar(255) NOT NULL,
  `exfee` varchar(11) NOT NULL,
  `payfee` varchar(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);

pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_help')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `title` varchar(50) NOT NULL,
  `content` text NOT NULL,
  `sort` int(11) NOT NULL,
  `time` datetime NOT NULL,
  `uniacid` int(11) NOT NULL,
  `state` tinyint(1) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_love')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `u_id` int(11) NOT NULL,
  `store_id` int(11) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `time` datetime NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);

pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_marketbuy')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `market_id` int(11) NOT NULL,
  `u_id` int(11) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `time` datetime NOT NULL,
  `fee` varchar(11) NOT NULL,
  `pay` tinyint(1) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_marketcate')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `cate` varchar(10) NOT NULL,
  `p_id` int(11) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `img` varchar(300) NOT NULL,
  `showhide` tinyint(1) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);

pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_marketmoney')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `publishfee` varchar(11) NOT NULL,
  `upfee` varchar(11) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `bzj` varchar(11) NOT NULL,
  `topfee` varchar(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_marketpublish')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `title` varchar(32) NOT NULL,
  `formid` varchar(32) NOT NULL,
  `fmoney` varchar(11) NOT NULL,
  `lmoney` varchar(11) NOT NULL,
  `co_id` int(11) NOT NULL,
  `ct_id` int(11) NOT NULL,
  `cth_id` int(11) NOT NULL,
  `exfee` varchar(11) NOT NULL,
  `detail` varchar(500) NOT NULL,
  `img` varchar(1200) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `pay` tinyint(1) NOT NULL COMMENT '0、未支付，1、已支付',
  `state` tinyint(1) NOT NULL COMMENT '1、未审，2、已审，3拒绝',
  `upfee` tinyint(1) NOT NULL COMMENT '0、未，1、ok',
  `topfee` tinyint(1) NOT NULL COMMENT '0、未，1、ok',
  `fromtime` varchar(20) NOT NULL,
  `totime` varchar(20) NOT NULL,
  `time` datetime NOT NULL,
  `paycode` varchar(32) NOT NULL,
  `phone` varchar(11) NOT NULL,
  `video` varchar(255) NOT NULL,
  `view` text NOT NULL,
  `agree` text NOT NULL,
  `bzj` varchar(11) NOT NULL,
  `payfee` varchar(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_marketrule')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `marketrule` text NOT NULL,
  `uniacid` int(11) NOT NULL,
  `time` datetime NOT NULL,
  `img` varchar(255) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_orderassess')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `u_id` int(11) NOT NULL,
  `p_id` int(11) NOT NULL,
  `content` text NOT NULL,
  `uniacid` int(11) NOT NULL,
  `time` datetime NOT NULL,
  `state` tinyint(1) NOT NULL,
  `formid` varchar(30) NOT NULL,
  `star` tinyint(1) NOT NULL,
  `img` varchar(1200) NOT NULL,
  `desstar` tinyint(1) NOT NULL,
  `speedstar` tinyint(1) NOT NULL,
  `pricetag` tinyint(1) NOT NULL,
  `speedtag` tinyint(1) NOT NULL,
  `packtag` tinyint(1) NOT NULL,
  `babytag` tinyint(1) NOT NULL,
  `confidetag` tinyint(1) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_orders')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `u_id` int(11) NOT NULL,
  `p_id` int(11) NOT NULL,
  `type` tinyint(1) NOT NULL COMMENT '1、抖宝；2、微拍；3、地摊；4、定制',
  `ordernum` varchar(30) NOT NULL,
  `ofee` varchar(11) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `time` datetime NOT NULL,
  `state` tinyint(1) NOT NULL COMMENT '付款状态',
  `message` varchar(300) NOT NULL,
  `phone` varchar(11) NOT NULL,
  `uname` varchar(20) NOT NULL,
  `address` varchar(30) NOT NULL,
  `num` int(11) NOT NULL,
  `ofees` varchar(11) NOT NULL,
  `formid` varchar(32) NOT NULL,
  `paycode` varchar(32) NOT NULL,
  `timesjc` varchar(20) NOT NULL,
  `stime` int(15) NOT NULL,
  `etime` int(15) NOT NULL,
  `udelete` tinyint(1) NOT NULL,
  `exformid` varchar(32) NOT NULL,
  `excompany` varchar(32) NOT NULL,
  `exordernum` varchar(32) NOT NULL,
  `excompanys` varchar(32) NOT NULL,
  `exordernums` varchar(32) NOT NULL,
  `extime` datetime NOT NULL,
  `paytime` datetime NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);

pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_primoney')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `publishfee` varchar(11) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `upfee` varchar(11) NOT NULL,
  `topfee` varchar(11) NOT NULL,
  `lookfee` varchar(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_pripublish')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `openid` varchar(255) NOT NULL,
  `c_id` int(11) NOT NULL,
  `title` varchar(32) NOT NULL,
  `content` text NOT NULL,
  `img` varchar(1200) NOT NULL,
  `topfee` int(11) NOT NULL,
  `upfee` tinyint(1) NOT NULL,
  `pay` tinyint(1) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `time` datetime NOT NULL,
  `type` tinyint(1) NOT NULL COMMENT '1、用户；2、商家',
  `formid` varchar(32) NOT NULL,
  `paycode` varchar(32) NOT NULL,
  `state` tinyint(1) NOT NULL COMMENT '1、未审核，2、审核3、拒审',
  `phone` varchar(11) NOT NULL,
  `view` text NOT NULL,
  `lookpro` text NOT NULL,
  `agree` text NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);

pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_register')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `username` varchar(10) NOT NULL,
  `phone` varchar(20) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `time` datetime NOT NULL,
  `openid` varchar(300) NOT NULL,
  `avatar` varchar(255) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_shotbuy')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `shot_id` int(11) NOT NULL,
  `u_id` int(11) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `time` datetime NOT NULL,
  `fee` varchar(11) NOT NULL,
  `formid` varchar(32) NOT NULL,
  `pay` tinyint(1) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);

pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_shotmoney')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `publishfee` varchar(11) NOT NULL,
  `upfee` varchar(11) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `bzj` varchar(11) NOT NULL,
  `topfee` varchar(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_shotpublish')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `title` varchar(32) NOT NULL,
  `formid` varchar(32) NOT NULL,
  `shotmoney` varchar(11) NOT NULL,
  `addmoney` varchar(11) NOT NULL,
  `ckmoney` varchar(11) NOT NULL,
  `c_id` int(11) NOT NULL,
  `exfee` varchar(11) NOT NULL,
  `detail` varchar(500) NOT NULL,
  `img` varchar(1200) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `pay` tinyint(1) NOT NULL COMMENT '0、未支付，1、已支付',
  `state` tinyint(1) NOT NULL COMMENT '1、未审，2、已审，3拒绝',
  `upfee` tinyint(1) NOT NULL COMMENT '0、未，1、ok',
  `topfee` tinyint(1) NOT NULL COMMENT '0、未，1、ok',
  `fromtime` varchar(20) NOT NULL,
  `totime` varchar(20) NOT NULL,
  `time` datetime NOT NULL,
  `paycode` varchar(32) NOT NULL,
  `phone` varchar(11) NOT NULL,
  `video` varchar(255) NOT NULL,
  `videoimg` varchar(255) NOT NULL,
  `view` text NOT NULL,
  `agree` text NOT NULL,
  `bzj` varchar(11) NOT NULL,
  `payfee` varchar(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);

pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_shotrule')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `shotrule` text NOT NULL,
  `uniacid` int(11) NOT NULL,
  `time` datetime NOT NULL,
  `img` varchar(255) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_shset')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `dbshset` tinyint(1) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `dbassessshset` tinyint(1) NOT NULL,
  `cusshset` tinyint(1) NOT NULL,
  `shotshset` tinyint(1) NOT NULL,
  `shotassessshset` tinyint(1) NOT NULL,
  `marketshset` tinyint(1) NOT NULL,
  `marketassessshset` tinyint(1) NOT NULL,
  `prishset` tinyint(1) NOT NULL,
  `priassessshset` tinyint(1) NOT NULL,
  `orderassessshset` tinyint(1) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_system')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `appid` varchar(100) NOT NULL COMMENT 'appid',
  `appsecret` varchar(200) NOT NULL COMMENT 'appsecret',
  `uniacid` varchar(50) NOT NULL COMMENT '所属模块',
  `appkey` varchar(50) NOT NULL COMMENT '短信appkey',
  `tpl_id` varchar(20) NOT NULL COMMENT '短信模板id',
  `pt_name` varchar(30) NOT NULL COMMENT '平台名称',
  `pt_tel` varchar(20) NOT NULL COMMENT '平台电话',
  `mac_id` varchar(20) NOT NULL COMMENT '商户号',
  `apikey` varchar(100) NOT NULL COMMENT '商户密钥',
  `apiclient_cert` text NOT NULL COMMENT 'apiclient_cert',
  `apiclient_key` text NOT NULL COMMENT 'apiclient_key',
  `copy` varchar(50) NOT NULL COMMENT '底部版权文字',
  `img` varchar(100) NOT NULL COMMENT '底部版权图标',
  `link` varchar(255) NOT NULL COMMENT '底部版权链接',
  `sell_order` varchar(100) NOT NULL COMMENT '外卖下单通知',
  `sell_getorder` varchar(100) NOT NULL COMMENT '外卖接单通知',
  `sell_reorder` varchar(100) NOT NULL COMMENT '拒绝接单通知',
  `sell_remoney` varchar(100) NOT NULL COMMENT '退款通知',
  `applyin` varchar(100) NOT NULL COMMENT '入住申请通知',
  `verifyin` varchar(100) NOT NULL COMMENT '入住审核通知',
  `tel` varchar(20) NOT NULL COMMENT '客服电话',
  `address` varchar(50) NOT NULL COMMENT '坐标地址',
  `latlng` varchar(50) NOT NULL COMMENT '坐标',
  `templeid` varchar(100) NOT NULL,
  `templeidbuy` varchar(100) NOT NULL,
  `templeidos` varchar(100) NOT NULL,
  `templeidoo` varchar(100) NOT NULL,
  `templeidofee` varchar(100) NOT NULL,
  `templeidapply` varchar(100) NOT NULL,
  `templeidove` varchar(100) NOT NULL,
  `ip_address` varchar(32) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_gjw_visit')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `nickname` varchar(20) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `time` datetime NOT NULL,
  `openid` varchar(100) NOT NULL,
  `avatar` varchar(255) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
?>